package com.ruoyi;


import com.googlecode.aviator.AviatorEvaluator;
import com.googlecode.aviator.Expression;

import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;
import java.io.File;

/**
 * Run a script under examples folder.
 *
 * @author dennis(killme2008@gmail.com)
 *  注入全局变量到脚本
 */
public class aVars {

    public static void main(final String[] args) throws Exception {
        Expression exp = AviatorEvaluator.getInstance().compileScript("examples/a.av",false);
        Boolean result =
            (Boolean) exp.execute(exp.newEnv("a", 1, "b", 2, "c", 3,"工龄",15,"员工信息集", new String[]{"林子恒", "张三"}));
    }

}
